﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Category.ascx.cs" Inherits="FrontEnd_Body_Left_Category" %>

<script type="text/javascript" language="javascript">
$(document).ready(function() {
	$("#root ul").each(function() {$(this).css("display", "none");});
	$("#root .category").click(function() {
	
		var childid = "#" + $(this).attr("childid");	
		
		if ($(childid).css("display") == "none") {$("#root ul").each(function() {$(this).css("display", "none");});$(childid).css("display", "block");}
		else {$(childid).css("display", "none");}
		
	});
});
</script>
<%-- onclick="GetListProductByCat(<%=cat.Id%>)"--%>
<div>
    <div class="category_items1">
        <ul id="root">
            <li class="name_store"><a href="#" class="border"><%=Component.Languages.SearchByKeyWord("kdtln")%></a></li>
            
            <%foreach (Component.Category cat in _xpCategory)
              { %>
            <li><a href="javascript:void(0);" childid='c_<%=cat.Id%>' class='category border'>&nbsp;&nbsp;<%=Component.CategoryDB.GetContentByLanguage(Component.ColumCategory._Name,cat)%></a>
            </li>
            <% _xpCateSub = Component.CategorySubDB.GetCategorySubByIdCat(cat.Id,false);
               if (_xpCateSub.Count > 0)
              { %>
            <ul id='c_<%=cat.Id%>'>
                <%foreach (Component.CategorySub catSub in _xpCateSub)
                  { %>
                <li><a href='javascript:void(0);' childid='c_<%=cat.Id%><%=catSub.Id%>' class='category' onclick="GetListProductBySubCat(<%=catSub.Id%>)">
                  »&nbsp;<%=Component.CategorySubDB.GetContentByLanguage(Component.ColumCategorySub._Name,catSub)%></a> </li>
                <%}%></ul>
            <%} %><%}%>
        </ul>
    </div>
</div>
